<?php
/**
 * Created by PhpStorm.
 * User: lijie
 * Date: 2018/10/7
 * Time: 17:58
 */
namespace app\reserve\model;

use think\Model;

class Cashbill extends Model{

    protected $table = "orange_cashbill";
    protected $autoWriteTimestamp = true;
    protected $createTime = "ctime";
    protected $updateTime = "utime";
    protected $dateFormat;
    protected $insert = ['status'=>0];

    /**
     * Notes:  列表
     * Create Date: 2018/10/7
     * Create by :lijie
     */
    public function selectBill($where,$pagenum,$listNum)
    {
        $res = $this->alias("b")
                    ->field("b.*,c.name cash_name")
                    ->where($where)
                    ->join("__CASH__ c","b.a_id = c.a_id",'LEFT')
                    ->order("b.ctime desc")->page($pagenum,$listNum)->select();
        return $res;
    }
}